//2009/08/15 18:30:09
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class GolfScore
{
public:
    int tally(vector <int> par, vector <string> Sheet)
    {
		int total = 0;
		for(int i=0; i<par.size(); i++)
		{
			int temp = par[i];
			if(Sheet[i] == "triple bogey") temp += 3;
			else if(Sheet[i] == "double bogey") temp += 2;
			else if(Sheet[i] == "bogey") temp += 1;
			else if(Sheet[i] == "par") temp += 0;
			else if(Sheet[i] == "birdie") temp += -1;
			else if(Sheet[i] == "eagle") temp += -2;
			else if(Sheet[i] == "albatross") temp += -3;
			else temp = 1;
			total += temp;
		}
		return total;
    }
};
